
#ifndef IComparable_t_h
#define IComparable_t_h

// Riccsson includes.
#include <Typedef.h>
#include <Defines.h>
#include <System/Object.h>

namespace Riccsson
{
	namespace System
	{
		namespace Generic
		{
			// Summary:
			//     Defines a generalized comparison method that a value type or class implements
			//     to create a type-specific comparison method for ordering instances.
			//
			// Type parameters:
			//   T:
			//     The type of objects to compare.This type parameter is contravariant. That
			//     is, you can use either the type you specified or any type that is less derived.
			//     For more information about covariance and contravariance, see Covariance
			//     and Contravariance in Generics.
			template<typename T> interface IComparable
			{
				// Summary:
				//     Compares the current object with another object of the same type.
				//
				// Parameters:
				//   other:
				//     An object to compare with this object.
				//
				// Returns:
				//     A value that indicates the relative order of the objects being compared.
				//     The return value has the following meanings: Value Meaning Less than zero
				//     This object is less than the other parameter.Zero This object is equal to
				//     other. Greater than zero This object is greater than other.
				public: virtual int CompareTo(T* other) = 0;

				public: int CompareTo(const T* other) const
				{
					return const_cast<IComparable<T>*>(this)->CompareTo(other);
				}
			};
		}
	}
}

#endif // ICOMPARABLE_H